<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="dataSet.*" %>
<%@ page import="entidades.*" %>

<%
//si esta logeado
if(session.getAttribute("currentSessionUser") != null){
	session.setAttribute("paginaActiva", "ABMComisiones");
%>

<%@ include file = "estructura/Header.jsp" %>

<div id="main">
	
	<%@ include file = "estructura/MenuAdmin.jsp" %>
		
	<div id="content">
	<h1>ABM Comisiones</h1><br>
		<table>
			<tr>
			<th>ID Comision</th>
			<th>Nombre</th>
			<th>Plan</th>
			<th>A&ntildeo Especialidad</th>
			</tr>
			<tr>
			
		<%
		/*if(session.getAttribute("materias") != null){
			ArrayList<Materia> listaMateria = new ArrayList<Materia>();
			listaMateria = (ArrayList<Materia>)session.getAttribute("materias");
			for(Materia materias: listaMateria){	*/
		if(request.getAttribute("comisionesPlan") != null){
				ArrayList<ComisionPlan> listaComisionPlan = new ArrayList<ComisionPlan>();
				listaComisionPlan = (ArrayList<ComisionPlan>)request.getAttribute("comisionesPlan");
				for(ComisionPlan cp: listaComisionPlan){
				//if (materias.getIdPlan() == cp.getIdPlan() )	
							
			
		%>
		
			<td>
		<%	
				out.println(cp.getId() + "</td>");
		%>
			<td>
		<%	
				out.println(cp.getDescripcionComision() + "</td>");
		%>
			<td>
		<%	
				out.println(cp.getDescripcionPlan() + "</td>");
		%>
		
			<td>
		<%	
				out.println(cp.getAnioEspecialidad() + "</td>");
		%>
		<td ><form  action="OpcionesAdmin" method="get" enctype="multipart/form-data" name="form"><input name="o" id="o" type="hidden"  value="63"><input name="idComisionEliminar"  type="hidden"  value="<%=cp.getId()%>"><input name="boton" id="boton" value="Eliminar" type="submit"></form></td>	</tr>
				
		
			<%
						
					}
			%>
				
				</table><br><br>
			<%} %>
				<form  action="OpcionesAdmin" method="get" enctype="multipart/form-data" name="form"><input name="o" id="o" type="hidden"  value="64"><input name="boton" id="boton" value="Agregar" type="submit"></form>
				<% 		
		
		
			
				%>
			</div>
</div>
<%@ include file = "estructura/Footer.jsp" %>

<%}else{ //no logueado, se redirecciona a login%>



<meta http-equiv="refresh" content="0;URL=Login.jsp">

</html>
<%}%>
		